<?php
/**
 * The html template file of index method of index module of zentaoPHP.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php
js::import($webRoot.'module/user/js/jquery.js');
js::import($webRoot.'module/user/js/zui.min.js');
js::import($webRoot.'module/user/js/zui.chart.min.js');?>
<style>
  .table-bordered td, .table-bordered th {
    border: 1px solid #989090 ! important;
  }
  .table>thead>tr>th{
    border: 1px solid #989090 ! important;
  }
  .panel{border: 1px solid #989090 ! important;}
  .dropdown-toggle{cursor: pointer;}
  .dropdown-menu li a{cursor: pointer;}
</style>
<div class="panel">
  <div class="panel-heading text-center">
    <strong>
      <span style="position: relative">
          <a class="dropdown-toggle nian" style="color: #333" data-toggle="dropdown" data-years="<?php echo $time;?>"> <?php echo $time.'年';?></a>
          <ul class="dropdown-menu checknian">
            <?php foreach($years as $key=>$val):?>
              <?php if($key<=$nowyears):?>
                <li><a data-years="<?php echo $key?>"><?php echo $val;?></a></li>
              <?php endif?>
            <?php endforeach?>
          </ul>
          </span>
      各单位警务监督考评表
    </strong>
  </div>
  <table class="table table-data table-bordered text-center table-fixedHeader">
    <thead>
    <tr class="text-center">
      <th rowspan="2">单位</th>
      <th rowspan="2">得分</th>
      <th colspan="5">问责方式（人次）</th>
    </tr>
    <tr class="text-center">
      <th>扣分</th>
      <th>通报批评</th>
      <th>责令谈话</th>
      <th>谈话提醒</th>
      <th>诫勉谈话</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($unit as $uval):?>
    <tr>
      <td>
        <a href="<?php echo $this->createLink("statistics","pstatis","unit={$uval->unit_id}&time={$time}")?>" target="_blank" style="color: #141414">
          <?php echo $uval->unit_name;?>
        </a>
      </td>
      <td>
        <?php echo $uval->sums;?>
      </td>
      <td>
        <?php if($uval->score):?>
          <?php echo html::a($this->createLink('statistics', 'pappraisal', "unitid={$uval->unit_id}&type=score&start={$uval->startDate}&end={$uval->endDate}&sum={$uval->score}"),$uval->score,"","data-toggle='modal' class='model'") ;?>
        <?php endif?>
      </td>
      <td>
        <?php if($uval->notification):?>
          <?php echo html::a($this->createLink('statistics', 'pappraisal', "unitid={$uval->unit_id}&type=notification&start={$uval->startDate}&end={$uval->endDate}&sum={$uval->notification}"),$uval->notification,"","data-toggle='modal' class='model'") ;?>
        <?php endif?>
      </td>
      <td>
        <?php if($uval->zlth):?>
          <?php echo html::a($this->createLink('statistics', 'pappraisal', "unitid={$uval->unit_id}&type=zlth&start={$uval->startDate}&end={$uval->endDate}&sum={$uval->zlth}"),$uval->zlth,"","data-toggle='modal' class='model'") ;?>
        <?php endif?>
      </td>
      <td>
        <?php if($uval->remind):?>
          <?php echo html::a($this->createLink('statistics', 'pappraisal', "unitid={$uval->unit_id}&type=remind&start={$uval->startDate}&end={$uval->endDate}&sum={$uval->remind}"),$uval->remind,"","data-toggle='modal' class='model'") ;?>
        <?php endif?>
      </td>
      <td>
        <?php if($uval->admonishing):?>
          <?php echo html::a($this->createLink('statistics', 'pappraisal', "unitid={$uval->unit_id}&type=admonishing&start={$uval->startDate}&end={$uval->endDate}&sum={$uval->admonishing}"),$uval->admonishing,"","data-toggle='modal' class='model'") ;?>
        <?php endif?>
      </td>
    </tr>
    <?php endforeach?>

    </tbody></table>
</div>
<script>
  $('.checknian').find('li').find('a').click(function(){
    $('.nian').text($(this).text());
    $('.nian').attr("data-years",$(this).attr("data-years"));
    var time = $(this).attr("data-years");
    var url = "/index.php?m=statistics&f=appraisal&starttime="+time;
    window.location.href =url;
  })

</script>
<?php include '../../common/view/footer.html.php';?>
